package com.benjaminwan.read.free.model.bean

data class DetailBean(
    var author: String = "",
    var uid: String = "",
    private var avatarUrl: String = "",
    var postId: String = "",
    private var _timePost: String = "",
    var floor: Int = 0,
    var postStatus: String = "",
    var page: Int = 0,
    var isWarned: Boolean = false,
    var isSelectMode: Boolean = false,
    var isHighlightMode: Boolean = false,
    val contents: Contents = Contents()
) {

    var timePost: String
        get() = _timePost
        set(value) {
            _timePost = value.substring(4)
        }

    val images: List<ContentImg>
        get() = contents.list.filterIsInstance<ContentImg>()

    fun setAvatarUrl(avatarUrl: String) {
        if (avatarUrl.contains("noavatar")) {
            this.avatarUrl = ""
        } else {
            this.avatarUrl = avatarUrl
        }
    }


}